package com.heima.model.common.enums;

public enum AppHttpCodeEnum {

    // 成功段0
    SUCCESS(0,"操作成功"),
    // 登录段1~50
    NEED_LOGIN(1,"需要登录后操作"),
    LOGIN_PASSWORD_ERROR(2,"密码错误"),
    // TOKEN50~100
    TOKEN_INVALID(50,"无效的TOKEN"),
    TOKEN_EXPIRE(51,"TOKEN已过期"),
    TOKEN_REQUIRE(52,"TOKEN是必须的"),
    // SIGN验签 100~120
    SIGN_INVALID(100,"无效的SIGN"),
    SIG_TIMEOUT(101,"SIGN已过期"),
    // 参数错误 500~1000
    PARAM_REQUIRE(500,"缺少参数"),
    PARAM_INVALID(501,"无效参数"),
    PARAM_IMAGE_FORMAT_ERROR(502,"图片格式有误"),
    FAIL_UPLOAD_PICTURE(505,"文件上传失败"),
    SERVER_ERROR(503,"服务器内部错误"),
    START_ERROR(504,"启动状态无法删除"),
    // 数据错误 1000~2000
    DATA_EXIST(1000,"数据已经存在"),
    AP_USER_DATA_NOT_EXIST(1001,"ApUser数据不存在"),
    DATA_NOT_EXIST(1002,"数据不存在"),
    AD_USER_DATA_NOT_EXIST(1003,"用户不存在"),
    AD_USER_STUTAS_INVLID(1004,"用户不可用"),
    NAME_PASSWORD_IS_NULL(1005,"用户名密码不能为空"),
    AP_USER_REALNAME_ERROR(1006,"用户真实信息审核状态异常"),
    ADD_AUTH_USER_ERROR(1007,"添加文章作者用户异常"),
    AP_USER_REALNAME_NOT_EXIST(1008,"用户真实信息不存在"),
    MEDIA_USER_IS_EXIST(1009,"自媒体账户已存在"),
    AUTH_USER_IS_EXIST(1010,"文章作者用户已存在"),
    CREATE_MEDIA_FAIL(1011,"创建自媒体账户失败"),
    IDNO_FAIL(1012,"身份证验证失败"),
    UPDATE_AP_USER_FAIL(1012,"身份证验证失败"),
    FILE_DELETE_ERROR(1013,"删除素材失败"),
    // 数据错误 3000~3500
    NO_OPERATOR_AUTH(3000,"无权限操作"),
    NEED_ADMIND(3001,"需要管理员权限");

    int code;
    String errorMessage;

    AppHttpCodeEnum(int code, String errorMessage){
        this.code = code;
        this.errorMessage = errorMessage;
    }

    public int getCode() {
        return code;
    }

    public String getErrorMessage() {
        return errorMessage;
    }
}
